const fs=require("fs")
const path = require("path")

const path_ = path.resolve(__dirname, '../extension')

// let path_=__dirname+"/extension"
console.log('path_ -   ', path_)

const path_2 = path.join(__dirname, '../extension.zip')
console.log('path_2 - - - -   ', path_2)


fs.unlinkSync(path_2)

deleteFolder(path_)

function deleteFolder(path_) {
    let files = [];
    if( fs.existsSync(path_) ) {
        files = fs.readdirSync(path_);
        files.forEach(function(file,index){
            let curPath = path_ + "/" + file;
            if(fs.statSync(curPath).isDirectory()) {
                deleteFolder(curPath);
            } else {
                fs.unlinkSync(curPath);
            }
        });
        fs.rmdirSync(path_);
    }
}